import React, { memo } from 'react';
import { Icon } from 'antd';
import GridCellEditWrapper from '@/components/form/gridcelleditwrapper';
import styles from './index.less';
interface SelectorWrapperProps {
  visible?: boolean;
  onClick?: () => void;
  value?: any;
}
export default memo(function SelectorWrapper(props: SelectorWrapperProps) {
  const { visible, onClick, value, ...restProps } = props;
  return (
    <>
      <GridCellEditWrapper
        style={{ width: '100%', display: 'inline-block', verticalAlign: 'top' }}
        visible={visible}
        autoFocus
        {...restProps}
      >
        <div className={styles.selector} onClick={onClick}>
          <div className={styles.label}>{value}</div>
          <div className={styles.btn}>
            <Icon type="search" />
          </div>
        </div>
      </GridCellEditWrapper>
    </>
  );
});
